<?php
namespace App\Controllers\Task;
/**
*	任务列表;
 *
*/
use App\Models\Task\Task;
class GetTaskList extends \App\Libs\Base\BaseAction
{
	
	public function execute(){

        $page = $this->request->getQuery('page','int',1);
        $size = $this->request->getQuery('size','int',10);
        $offset = ($page - 1)* $size;

        $matchTask = Task::findAll([
            'columns' => 'id,task_title,task_icon,task_banner,task_intro,isshow',
            'order' => 'isshow desc,ctime desc',
            'offset' => $offset,
            'limit' => $size
        ]);

        $num = Task::count();

        return \App\Libs\Views\Json::view(0, '成功', ['task_list' =>$matchTask,'sum' => $num]);
    }

}
